﻿using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Elsa.Workflows.Management.Entities;
using Elsa.Workflows.Runtime.Messages;
using Elsa.Workflows.State;
using Microsoft.EntityFrameworkCore;
using T.FAS.Runtime.MF.Common;
using T.FAS.Runtime.MF.Entity;

public interface IElsaEngine
{
    /// <summary>
    /// 执行指定的流程定义（最新版本），并传入输入参数。
    /// </summary>
    /// <param name="definitionId">流程定义 ID</param>
    /// <param name="input">输入参数字典</param>
    /// <param name="cancellationToken">可选的取消令牌</param>
    /// <returns>返回执行结果</returns>
    Task<ElsaExecutionResult> ExecuteAsync(
        string definitionId,
        IDictionary<string, object> input,
        Dictionary<string, string> extraParams = null,
        CancellationToken cancellationToken = default);
    Task<RunWorkflowInstanceResponse> StartNewWorkflowInstanceAsync(
        string definitionId,
        IDictionary<string, object> input,
        CancellationToken cancellationToken = default);

    Task<WorkflowDefinition> PublishAsync(Microflow def,
        CancellationToken cancellationToken = default);

    List<WorkflowInstanceDetail> GetExecuteDetail(string instanceId);
}


